import axios from "../index.js";
// 预警到岗到位
// 列表
export const getListApi = (data) => {
  return axios.request({
    url: "/warning/warningArrivePost/listPage",
    method: "post",
    data: data
  });
};

// 新增
export const addApi = (data) => {
  return axios.request({
    url: "/warning/warningArrivePost/save",
    method: "post",
    data: data
  });
};
// 提交
export const submitApi = (data) => {
  return axios.request({
    url: "/warning/warningArrivePost/submit",
    method: "post",
    data: data
  });
};

// 编辑
export const updateApi = (data) => {
  return axios.request({
    url: "/warning/warningArrivePost/updById",
    method: "post",
    data: data
  });
};

// 获取详情
export const getByIdApi = (data) => {
  return axios.request({
    url: "/warning/warningArrivePost/getById",
    method: "get",
    data: data
  });
};

// 获取全部预警通知单
export const getAllWarningNotifApi = (data) => {
  return axios.request({
    url: "/warning/warningNotification/getList",
    method: "post",
    data: data
  });
};

// 删除
export const delApi = (id) => {
  return axios.request({
    url: `/warning/warningArrivePost/deleteById/${id}`,
    method: "get"
    // data: data
  });
};

// 获取人员选择
export const getPersonsApi = (data) => {
  return axios.request({
    url: "/warning/warningArrivePost/getStandardList",
    method: "post",
    data: data
  });
};
// 导出
export const exportFileApi = (data) => {
  return axios.request({
    url: "/warning/warningArrivePost/exportData",
    method: "post",
    data: data,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    responseType: "blob"
  });
};
